var t = require;
var e = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var a = (function () {
    function t() {
        this._isNativeDo = !1;
        this.defPath = "";
        this.defDir = "yaopao";
        this.fileName = "mpData.txt";
    }
    Object.defineProperty(t, "instance", {
        get: function () {
            if (null == this._instance) {
                this._instance = new t();
                if (jsb && jsb.fileUtils && jsb.fileUtils.getWritablePath) {
                    this._instance.defPath = jsb.fileUtils.getWritablePath();
                    console.log("原生平台存储路径" + this._instance.defPath);
                    var e = this._instance.newPath;
                    jsb.fileUtils.isDirectoryExist(e) || jsb.fileUtils.createDirectory(e);
                    this._instance._isNativeDo = !0;
                } else {
                    this._instance._isNativeDo = !1;
                    cc.log("当前为非原生平台");
                }
            }
            return this._instance;
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "newPath", {
        get: function () {
            return this.defPath + this.defDir;
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "isNativeDo", {
        get: function () {
            return this._isNativeDo;
        },
        enumerable: !1,
        configurable: !0
    });
    t.prototype.save = function (t) {
        this.isNativeDo && "" != t && jsb.fileUtils.writeStringToFile(t, this.newPath + "/" + this.fileName);
    };
    t.prototype.getSaveData = function () {
        if (this.isNativeDo) {
            var t = jsb.fileUtils.getStringFromFile(this.newPath + "/" + this.fileName);
            if (null != t) return t;
        }
        return "";
    };
    t.prototype.remove = function () {};
    return t;
})();
o.default = a;
